package com.yinhai.mycat_test.service.write.impl;

import com.yinhai.mycat_test.entity.User;
import com.yinhai.mycat_test.mapper.write.UserWriteMapper;
import com.yinhai.mycat_test.service.write.UserWriteService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserWriteServiceImpl implements UserWriteService {
    @Resource
    UserWriteMapper userWriteMapper;


    @Override
    public void insertUser(User user) {
        userWriteMapper.insertUser(user);
    }

    @Override
    public void deleteAllUser() {
        userWriteMapper.deleteAllUser();
    }

    @Override
    public void batchInsertUser(List<User> list) {
        userWriteMapper.batchInsertUser(list);
    }

    @Override
    public void batchDeleteUserById(@Param("list") List<Integer> lists) {
        userWriteMapper.batchDeleteUserById(lists);
    }

    @Override
    public void deleteUserById(Integer id) {
        userWriteMapper.deleteUserById(id);
    }
}
